package org.testmyapp.entities;

public class RetentionPk {

	public TariffInstancePk tariffInstance;
	public CoveragePk coverage;

	public RetentionPk() {

	}

	public RetentionPk(TariffInstancePk ip, CoveragePk tarif) {
		this.tariffInstance = ip;
		this.coverage = tarif;
	}

	@Override
	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (!other.getClass().equals(this.getClass())) {
			return false;
		}
		RetentionPk otherObject = (RetentionPk) other;
		if (otherObject == this) {
			return true;
		}
		if (tariffInstance != null && otherObject.tariffInstance != null
				&& tariffInstance.equals(otherObject.tariffInstance)) {
			if (coverage != null && otherObject.coverage != null
					&& coverage.equals(otherObject.coverage)) {
				return true;
			}
		}
		return false;
	}

	@Override
	public int hashCode() {
		if (tariffInstance == null || coverage == null) {
			return 0;
		} else {
			return tariffInstance.hashCode() ^ coverage.hashCode();
		}
	}
}
